
#ifndef _MEMBER_BTREEITEM_H_
#define _MEMBER_BTREEITEM_H_

#include <BTextFormat>
#include <BScrollBar>
#include <BTreeWidget>
#include "IAlignItem.h"

#define item_member(item)		((member_BTreeItem*)((BTreeItem*)item)->_ptr)

namespace BWE
{
	class member_BTreeItem : public IAlignItem
	{
		friend class BTreeItem;
	public:
		member_BTreeItem(BTreeItem* treeItem);
		~member_BTreeItem();

		void attach(BTreeWidget* treeWidget);
		void detach(BTreeWidget* treeWidget);

		void dirtyTree();
		void raiseSignal(int signal, const BValue& value = BValue());

		void dispenseUpperStyles(BTreeItem* upper);
		void dispenseStyles(const BStyle* style);

		void adjustArrowRect(const BPoint& offset);

		BTreeWidget*		tree;
		BTreeItem*			parent;
		bool				visible;
		bool				selected;
		bool				checked;
		bool				expanded;
		BFontHolder			localFont;
		BImageHolder		arrowImage;
		BArray<BTreeItemHolder>	children;

		int					indent;
		BRect				arrowArea;
		BRect				arrowRect;
		BRect				area;//include children.

	};
}
#endif